
package com.code.petapp.activity;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.bumptech.glide.Glide;
import com.code.petapp.R;
import com.code.petapp.databinding.ActivityOrderDetailBinding;
import com.code.petapp.util.SPCommonUtils;

public class OrderDetailActivity extends AppCompatActivity {
    ActivityOrderDetailBinding binding;

    @SuppressLint("SetTextI18n")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityOrderDetailBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        Intent intent = getIntent();
        int num = intent.getIntExtra("num",0);
        String time = intent.getStringExtra("time");
        String orderName = intent.getStringExtra("orderName");
        String goodsName = intent.getStringExtra("goodsName");
        String address = intent.getStringExtra("address");
        String phone = intent.getStringExtra("phone");
        String status = intent.getStringExtra("status");
        String img=intent.getStringExtra("imgUrl");
        Double price = intent.getDoubleExtra("price",0.0);
        Double onePrice = price/num;
       String orderId = intent.getStringExtra("orderId");
        String userName = intent.getStringExtra("userName");
        binding.recName.setText(userName);
        binding.name.setText(goodsName);
        binding.status.setText(status);
        binding.time.setText(time);
        binding.address.setText(address);
        binding.number.setText(orderId);
        binding.num.setText(num+"");
        binding.onePrice.setText(onePrice+"");
        binding.subPrice.setText(price+"");
        binding.phone.setText(phone);
        binding.orderName.setText(orderName);
        Glide.with(this).load(img).into(binding.imgAvatar);
    }
}